package BLL;//package BLL;
//
//import BIZ.UserBiz;
//import javabean.userDetails;
//
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import javax.servlet.http.HttpSession;
//import java.io.IOException;
//import java.nio.charset.StandardCharsets;
//
//@WebServlet(name = "UserPage", value = "/UserPage")
//public class UserPage extends HttpServlet {
//    private static final long serialVersionUID = 1L;
//    public UserPage() {
//        super();
//    }
//    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
//    {
//        response.setContentType("text/html;charset=UTF-8");
//        HttpSession session=request.getSession();
//
//        //获取表单递送用户名及密码
//        String UserName=new String(request.getParameter("UserName").getBytes(StandardCharsets.UTF_8));
//        String Password=new String(request.getParameter("Password").getBytes(StandardCharsets.UTF_8));
//
//
//
//        UserBiz userBiz=new UserBiz();
//        userDetails User = userBiz.getUser(UserName, Password);
//        userDetails user=userBiz.getuser(UserName,Password);
//        //判断用户是否为存在
//        if(User==null){
//            if(user==null){
//                System.out.println("0");
//                session.setAttribute("error",0);
//            }else{
//                System.out.println("1||0");
//                session.setAttribute("UserName",UserName); //用户名绑定至session
//                response.sendRedirect("UserPage.jsp");
//            }
//
//        }else{
//            session.setAttribute("UserName",UserName); //用户名绑定至session
//            response.sendRedirect("AdminPage.jsp");
//            System.out.println("2");
//
//        }
//
//
//
//
//
//
//
//
//
//
//        //由Mysql调用数据(当前值供前端测试使用)
//        String Type = "mouth";
//        String Balance = "120";
//        String RegistrationTime = "2022/3/8";
//        String LastRechargeTime = "2022/3/8";
//        String PhoneNumber = "15039512942";
//        String Email = "2655156865@qq.com";
//        String Balance_date = "55";
//        String Balance_Frequency="99";
//
//        String CarNumber1 = "L2727";
//        String CarNumber2 = "L2728";
//        String CarNumber3 = "";
//
//        int BillingRecords1Num=-30;
//        int BillingRecords2Num=-30;
//        int BillingRecords3Num=100;
//        int BillingRecords4Num=30;
//        int BillingRecords5Num=-30;
//
//        String BillingRecords1="2021/7/13";
//        String BillingRecords2="2021/6/13";
//        String BillingRecords3="2021/5/16";
//        String BillingRecords4="2021/5/13";
//        String BillingRecords5="2021/4/13";
//
//        //初始化数据
//
//        //用户信息绑定至session
//        session.setAttribute("Type",Type);
//        session.setAttribute("CarNumber1",CarNumber1);
//        session.setAttribute("CarNumber2",CarNumber2);
//        session.setAttribute("CarNumber3",CarNumber3);
//        session.setAttribute("Balance",Balance);
//        session.setAttribute("RegistrationTime",RegistrationTime);
//        session.setAttribute("LastRechargeTime",LastRechargeTime);
//        session.setAttribute("PhoneNumber",PhoneNumber);
////        session.setAttribute("Email",javax.validation.constraints.Email);
//        session.setAttribute("Balance_date",Balance_date);
//        session.setAttribute("Balance_Frequency",Balance_Frequency);
//        session.setAttribute("BillingRecords1Num",BillingRecords1Num);
//        session.setAttribute("BillingRecords2Num",BillingRecords2Num);
//        session.setAttribute("BillingRecords3Num",BillingRecords3Num);
//        session.setAttribute("BillingRecords4Num",BillingRecords4Num);
//        session.setAttribute("BillingRecords5Num",BillingRecords5Num);
//        session.setAttribute("BillingRecords1",BillingRecords1);
//        session.setAttribute("BillingRecords2",BillingRecords2);
//        session.setAttribute("BillingRecords3",BillingRecords3);
//        session.setAttribute("BillingRecords4",BillingRecords4);
//        session.setAttribute("BillingRecords5",BillingRecords5);
//    }
//
//    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        doGet(request, response);
//    }
//
//}
